<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        .layui-card {border:1px solid #f2f2f2;border-radius:5px;}
        .icon {margin-right:10px;color:#1aa094;}
        .icon-cray {color:#ffb800!important;}
        .icon-blue {color:#1e9fff!important;}
        .icon-tip {color:#ff5722!important;}
        .layuimini-qiuck-module {text-align:center;margin-top: 10px}
        .layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
        .layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
        .welcome-module {width:100%;height:210px;}
        .panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
        .panel-body {padding:10px}
        .panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
        .label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top: .3em;}
        .layui-red {color:red}
        .main_btn > p {height:40px;}
        .layui-bg-number {background-color:#F8F8F8;}
        .layuimini-notice:hover {background:#f6f6f6;}
        .layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
        .layuimini-notice-title,.layuimini-notice-label {
            padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;}
        .layuimini-notice-title {line-height:28px;font-size:14px;}
        .layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
    </style>
</head>
<body>
<div class="layuimini-container" style="height: 700px">
    <div class="layuimini-main">
            <fieldset class="layui-elem-field"  style="height: 600px">
                <legend>我的合同</legend>
                <div class="layui-field-box">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span style="color: red">*</span>姓名</label>
                            <div class="layui-input-inline">
                                <input lay-verify="required" disabled type="text" id="staffName" name="staffName" placeholder="     请选择"  lay-verType="tips" autocomplete="off" class="layui-input">
<!--                                <span style="position: relative;top: -26px;left: 10px;color: #8D8D8D" class="fa fa-search"></span>-->
                            </div>
                            <label class="layui-form-label"><span style="color: red">*</span>合同类型</label>
                            <div class="layui-input-inline">
                                <input disabled type="text" class="layui-input" name="contractType">

                            </div>
                            <label class="layui-form-label">合同名称</label>
                            <div class="layui-input-inline">
                                <input disabled type="text" class="layui-input" name="contractName" id="contractName">
                            </div>
                            <label class="layui-form-label">合同属性</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" disabled id="contractLevel" name="contractLevel" lay-verify="required">

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">转正标识</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" disabled id="ifRegular" name="ifRegular" lay-verify="required">

                            </div>
                            <label class="layui-form-label">合同状态</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" disabled id="contractState" name="contractState" lay-verify="required">

                            </div>
                            <label class="layui-form-label">合同期限</label>
                            <div class="layui-input-inline">
                                <input class="layui-input" disabled name="contractDeadline" id="contractDeadline" lay-verify="required">

                            </div>
                            <label class="layui-form-label">试用月数</label>
                            <div class="layui-input-inline">
                                <input disabled type="text" class="layui-input" name="trialMonth" id="trialMonth">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">试用工资</label>
                            <div class="layui-input-inline">
                                <input disabled type="text" class="layui-input" name="trialSalary" id="trialSalary">
                            </div>
                            <label class="layui-form-label">转正工资</label>
                            <div class="layui-input-inline">
                                <input  disabled type="text" class="layui-input" name="regularSalary" id="regularSalary">
                            </div>
                            <label class="layui-form-label">签约时间</label>
                            <div class="layui-input-inline">
                                <input disabled readonly type="text" class="layui-input" name="signTime" id="signTime">
                            </div>
                            <label class="layui-form-label">生效时间</label>
                            <div class="layui-input-inline">
                                <input disabled readonly type="text" class="layui-input" name="validTime" id="validTime">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">失效时间</label>
                            <div class="layui-input-inline">
                                <input disabled readonly type="text" class="layui-input" name="failureTime" id="failureTime">
                            </div>
                            <label style="width: 120px" class="layui-form-label">试用结束日期</label>
                            <div class="layui-input-inline">
                                <input disabled readonly style="width: 180px" type="text" class="layui-input" name="trialEndTime" id="trialEndTime">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-block">
                                <textarea disabled style="width: 1120px" name="contractRemark" id="contractRemark"  placeholder="请输入内容" class="layui-textarea"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
    </div>
</div>
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['layer', 'form','miniTab'], function() {
        var form = layui.form,
            layer = layui.layer,
            miniTab = layui.miniTab;
    })
    //日期选择器渲染
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#validTime',
        });
        laydate.render({
            elem: '#signTime'
        });
        laydate.render({
            elem: '#failureTime'
        });
        laydate.render({
            elem: '#trialEndTime'
        });

    });
</script>
<!--初始化-->
<script>
    let user;
    let contractInfo;
    $(function () {
        user = sessionStorage.getItem("user");   // 字符串
        user = JSON.parse(user);                  // 把一个json字符串转换成一个真正的json对象
        $.ajax({
            url : "/laborContract/selectById",
            method:'get',
            contentType:"application/json;charset=utf-8",
            datatype:"text",
            data:{id:user.staffId},
            success: function (response) {
                $('input[name="staffName"]').val(user.staffName);
                $('input[name="contractType"]').val(response.data.contractType);
                $('input[name="contractLevel"]').val(response.data.contractLevel);
                $('input[name="ifRegular"]').val(response.data.ifRegular);
                $('input[name="contractState"]').val(response.data.contractState);
                $('input[name="contractDeadline"]').val(response.data.contractDeadline);
                $('input[name="contractName"]').val(response.data.contractName);
                $('input[name="trialMonth"]').val(response.data.trialMonth);
                $('input[name="trialSalary"]').val(response.data.trialSalary);
                $('input[name="regularSalary"]').val(response.data.regularSalary);
                $('input[name="validTime"]').val(response.data.validTime);
                $('input[name="signTime"]').val(response.data.signTime);
                $('input[name="failureTime"]').val(response.data.failureTime);
                $('input[name="trialEndTime"]').val(response.data.trialEndTime);
                $('textarea[name="contractRemark"]').val(response.data.contractRemark);
            },
            error: function (response) {
                layer.msg(response.msg)
            }
        })
    })
</script>
</body>
</html>
